﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace Utilities.CryptoHelper
{
    public static class Md5Helper
    {

        public static string MD5Encrypt16(string encryptString)
        {
            var md5 = new MD5CryptoServiceProvider();
            string t2 = BitConverter.ToString(md5.ComputeHash(Encoding.Default.GetBytes(encryptString)), 4, 8);
            t2 = t2.Replace("-", string.Empty);
            return t2;
        }


        public static string MD5Encrypt64(string encryptString)
        {
            var md5 = new MD5CryptoServiceProvider();
            return BitConverter.ToString(
                        new MD5CryptoServiceProvider()
                        .ComputeHash(Encoding.UTF8.GetBytes(encryptString))).Replace("-", "");
        }

    }
}
